 //
//  Z_MainViewController.m
//  Surveyer
//
//  Created by Qikun Guo on 13-7-19.
//  Copyright (c) 2013年 Tim. All rights reserved.
//

#import "Z_MainViewController.h"
#import "DebugViewController.h"
#import "SurveyerStore.h"
#import "SurveyerLoaderViewController.h"
#import "Flurry.h"

@interface Z_MainViewController ()
@property (weak, nonatomic) IBOutlet UIButton *designButton;
@property (weak, nonatomic) IBOutlet UIButton *surveyButton;
@property (weak, nonatomic) IBOutlet UIButton *resultButton;

@end

@implementation Z_MainViewController

@synthesize currentProjectLabel, labelShow;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        currentProjectLabel = nil;
        [Flurry logAllPageViews:self.navigationController];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [[SurveyerStore defaultStore] removeUncompletedSurvey];
	self.titleLabel.font = [UIFont fontWithName:@"Archive" size:35.0];
    //[self.titleLabel setTextColor:MAIN_COLOR];
    [self.designButton setTitleColor:DESIGN_COLOR forState:UIControlStateNormal];
    [self.surveyButton setTitleColor:SURVEY_COLOR forState:UIControlStateNormal];
    [self.resultButton setTitleColor:RESULT_COLOR forState:UIControlStateNormal];
#warning maybe need to localize the button text
    //self.view.backgroundColor = BKG_COLOR;
    
    labelShow.text = [[SurveyerStore defaultStore] stringToShow];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSString *x = segue.identifier;
    if ([x isEqualToString:@"Design"] || [x isEqualToString:@"Survey"] || [x isEqualToString:@"Result"])
    {
        [[SurveyerStore defaultStore] setTitle:segue.identifier];
    }
}
@end